import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { getCollection, listCollections } from "@/lib/public/queries"; import { Breadcrumbs } from "@/components/breadcrumbs"; import { ToolCard } from "@/components/tool-card"; import { fmtDate } from "@/lib/utils"; export const revalidate = 600; export async function generateStaticParams() { try { return (await listCollections()).map((c) => ({ slug: c.slug })); } catch { return []; } } export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise { const c = await getCollection((await params).slug); if (!c) return { title: "Not found" }; return { title: c.title, description: c.description.slice(0, 160), alternates: { canonical: `/collections/${c.slug}` } }; } export default async function CollectionPage({ params }: { params: Promise<{ slug: string }> }) { const c = await getCollection((await params).slug); if (!c) notFound(); return (

{c.title}

{c.description}

{c.items.length} tools · updated {fmtDate(c.updatedAt)} · i.slug).join(",")}`} rel="nofollow" className="text-accent hover:underline">compare the first four

Tools in this collection

    {c.items.map((t, i) =>
  1. {i + 1}
  2. )}
); }